package com.alibaba.otter.canal.rabbitmq;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 自定义消息
 */
public class CustomizedMessage implements Serializable {

    private static final long serialVersionUID = 1422351777339182022L;
    // private long                      id;
    private String                    database;
    private String                    table;
    private List<String> pkNames;
    private Boolean                   isDdl;
    private String                    type;
    // binlog executeTime
    private Long                      es;
    // dml build timeStamp
    private Long                      ts;
    //private String                    sql;
    //private Map<String, Integer>      sqlType;
    //private Map<String, String>       mysqlType;
    private List<Map<String, String>> data;
    private List<Map<String, String>> old;

    public CustomizedMessage() {
    }

    public CustomizedMessage(String database, String table, List<String> pkNames, Boolean isDdl, String type, Long es, Long ts, List<Map<String, String>> data, List<Map<String, String>> old) {
        this.database = database;
        this.table = table;
        this.pkNames = pkNames;
        this.isDdl = isDdl;
        this.type = type;
        this.es = es;
        this.ts = ts;
        this.data = data;
        this.old = old;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public List<String> getPkNames() {
        return pkNames;
    }

    public void setPkNames(List<String> pkNames) {
        this.pkNames = pkNames;
    }

    public Boolean getDdl() {
        return isDdl;
    }

    public void setDdl(Boolean ddl) {
        isDdl = ddl;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getEs() {
        return es;
    }

    public void setEs(Long es) {
        this.es = es;
    }

    public Long getTs() {
        return ts;
    }

    public void setTs(Long ts) {
        this.ts = ts;
    }

    public List<Map<String, String>> getData() {
        return data;
    }

    public void setData(List<Map<String, String>> data) {
        this.data = data;
    }

    public List<Map<String, String>> getOld() {
        return old;
    }

    public void setOld(List<Map<String, String>> old) {
        this.old = old;
    }

    @Override
    public String toString() {
        return "CustomizedMessage{" +
                "database='" + database + '\'' +
                ", table='" + table + '\'' +
                ", pkNames=" + pkNames +
                ", isDdl=" + isDdl +
                ", type='" + type + '\'' +
                ", es=" + es +
                ", ts=" + ts +
                ", data=" + data +
                ", old=" + old +
                '}';
    }
}
